  
<style>
    .label{cursor:pointer;}
    .table>tbody>tr>td{ padding:5px 2px;}
    .article-list p{margin-bottom: 5px;  word-wrap:break-word; overflow: hidden;}
    
    .article-list td { word-break: break-all; word-wrap:break-word; }
</style>
      

<div class="main">
	<div class="panel panel-default">
	    <div class="panel-heading">筛选</div>
	    <div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="kbwdl_shequzufang" />
			<input type="hidden" name="do" value="sendlist" />
			<input type="hidden" name="op" value="{$operation}" />
                        {if isset($_GPC['bid'])}
                        <input type="hidden" name="bid" value="{$_GPC['bid']}" />
                        {/if}
             <div style="display:flex;  align-items: center;">
                          
                           <div  style="display: flex; align-items: center; margin-right: 10px;">
                            <span style="display:table-cell; ">区域：</span>    
             <span style="display:table-cell; "> 
  <?php if(!empty($citys)){ echo
 form_element::select($citys,'city_id','city_id',1,'1','city', 'onchange="navcityto(this)"');
    }
 ?>      
       </span>
         <span id="areasbd" style="display:table-cell; ">  
 <?php  echo  form_element::select($sec['areas'],'area','area',$_GPC['area']); ?>
	 </span>
                            </div>
                          <div style="margin-right: 10px;">
                              <input class="form-control" name="keyword" id="" placeholder="请输入关键词或者手机号" type="text" value="{$_GPC['keyword']}">
			             </div>
                            <div  style="margin-right: 10px;">
                               <input type="checkbox" name="isonline" {if $_GPC['isonline']}checked="true"{/if} value="1"/> 待上架(下架) <br/>
                               <input type="checkbox" name="isdelete"  {if $_GPC['isdelete']}checked="true"{/if} value="1"/> 待审核（屏蔽） 
                            </div> 
                            <div  style="margin-right: 10px;">
            {php echo  form_element::select([0=>'出售',2=>'出租', 3=>'转让'],'renttype','renttype',$_GPC['renttype']);}         
                             </div> 
                     <div>
					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
				    </div>

			</div> 
 
		</form>
	    </div>
 
	<div class="panel-body table-responsive">
            <form action="./index.php" method="post" class="form-horizontal" role="form">
                <input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="kbwdl_shequzufang" />
			<input type="hidden" name="do" value="sendlist" />
			<input type="hidden" name="op" value="display" />
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
                                    <th style="width:5%;">ID</th>
					<th style="width:55%;">房源标题</th>
					 
					<th style="text-align:right; width:40%;">操作</th>
				</tr>
			</thead>
			<tbody class="article-list">
				{loop $list $item}
				<tr>
					<td>{$item['id']}
                                        <input type="checkbox" name="ids[]" value="{$item['id']}"/>
                                        </td>
					<td style="width: 55%; word-wrap:break-word;">
                                            <img src="{php echo tomedia($item['thumb'])}" style="float:left;  width:120px; height:100px; "/>
                                            <div style="padding-left:130px;">   
                                                <div style="display: flex; flex-direction: column;">
                                              <p> <span style="color:blue;">
                                                  
                                                    {if $item['zhutype']==0}[二手房]{/if}                                                    
                                                    {if $item['zhutype']==2}[租房]{/if}
                                                    {if $item['zhutype']==3}[新房]{/if}
                                                    {if $item['zhutype']==4}[商铺]{/if}                                                    
                                                    {if $item['zhutype']==7}[厂房]{/if}
                                                    {if $item['zhutype']==8}[仓库]{/if}
                                                    {if $item['zhutype']==9}[写字楼]{/if}
                                                    </span>   
					                        <span style="color:#bf0000">	
                                                {if $item['zhutype']>3}
                                                    {if $item['rent_type']==0}[出售]{/if}
                                                    {if $item['rent_type']==2}[出租]{/if}
                                                    {if $item['rent_type']==3}[转让]{/if}
                                                {/if}
                                            </span>
                                               {$item['title']}
                                            </p> 
                                                <p style="color:#999"> {$item['cityname']}- {$item['area']}-{$item['quan']}-{$item['village_name']}                                               
                                                    <!-- {if $item['employee']} <span style="color:#bf0000">-佣金：{$item['employee']}元</span>{/if} -->
                                                </p>
                                                 <p> 
                                                {if $item['zhutype']==4} {$item['prule']}{/if}
                                                {if $item['zhutype']==7 || $item['zhutype']==8 }
                                                    {$item['danyuan']} - {$item['dong']}
                                                {/if}
                                               <!--显示需求求购的内容-->
                                           {if $item['zhutype']< 4}<p>  
                                            {$item['house_type']} {$item['traveaux_finition']} 
                                             {$item['room']}房{$item['hall']}厅{$item['garder']}卫  
                                            {/if}
                                              {$item['superficie']}㎡  
                                              <span style="color: #bf0000;" >{$item['loyer']}{$item['prix_unitaire']}</span>
                                           </p>
                                           <div>
                                                <p>特色： {$item['disposition']}</p>
                                            </div>
                                        </div> 
                             </div>
					</td>
					<td style="text-align: right; ">
                        <div>
                            <p>
                                <span style="color:#555">更新：{php echo date('Y-m-d H:i:s',$item['update_time'])}</span> 
                        
                                <span style="color:#999">发布：{php echo date('Y-m-d H:i:s',$item['add_time'])}</span>
                              
                            </p>
                         </div>
                        <div>
					<p>	
                        <!-- <label data='{$item['istop']}' class='label label-default {if $item['istop']==1}label-info{else}{/if}' 
                                                       onclick="setProperty(this,{$item['id']},'istop')">置顶</label>-->
                        {if ($item['zhutype']==0 || $item['zhutype']==3)} 
                        <label data='{$item['ishot']}' class='label {if $item['ishot']>0} label-success{else}label-default{/if}'
                             onclick="setBandan(this,{$item['id']},'ishot')">捡漏榜</label> 
                        <label>|</label>
                        {/if}
						<label data='{$item['isjingpin']}' class='label label-default {if $item['isjingpin']==1}label-info{/if}'
                                                       onclick="setProperty(this,{$item['id']},'isjingpin')">必看</label>

						
                                        
						  <label data='{$item['show_jiaji']}' class='label label-default {if $item['show_jiaji']==1}label-info{/if}'
                                                       onclick="setProperty(this,{$item['id']},'show_jiaji')">抢手</label>
                                            
                                            <label data='{$item['show_you']}' class='label label-default {if $item['show_you']==1}label-info{/if}'
                                                       onclick="setProperty(this,{$item['id']},'show_you')">品质</label>
                                            
                                                 <label data='{$item['show_hight']}' class='label label-default {if $item['show_hight']==1}label-info{/if}'
                                                       onclick="setProperty(this,{$item['id']},'show_hight')">推荐</label>
                                
                             </p>
                         </div>
                        
                         <div>
                             <p>
						<label data='{$item['isonline']}' class='label  label-default {if $item['isonline']==1}label-info{/if}' onclick="setProperty(this,{$item['id']},'isonline')">{if $item['isonline']==1}上架{else}下架{/if}</label>
                                           
                                                <label data='{$item['isdelete']}' class='label  label-default {if $item['isdelete']==0}label-info{/if}' onclick="setProperty(this,{$item['id']},'isdelete')">{if $item['isdelete']==1}屏蔽{else}显示{/if}</label>
                              </p>

                         </div>
                         <div>
						<a href="{php echo $this->createWebUrl('send', array('id' => $item['id'], 'op' => 'display'))}" class="btn btn-default btn-sm"  title="编辑"><i class="fa fa-pencil"></i></a>&nbsp;&nbsp;

						<a href="{php echo $this->createWebUrl('sendlist', array('id' => $item['id'], 'op' => 'delete'))}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" class="btn btn-default btn-sm"  title="删除"><i class="fa fa-times"></i></a>
                        </div>
					</td>

				</tr>

				{/loop}

			</tbody>

		</table>
        <div class="pull-left we7-margin-top">
			<input type="checkbox" we7-check-all="1" name="select_all" id="select_all" value="1">
			<label for="select_all">&nbsp;</label>
                        移动到	 <?php  echo
 form_element::select($htype_option,'movhtype','movhtype',$_GPC['movhtype']);
 ?>
			<input type="hidden" name="token" value="{$_W['token']}" />
			<input type="submit" class="btn btn-danger" name="submit" value="确定移动" onclick="if(!confirm('确定移动房源吗？')) return false;"/>

            <a href="{php echo $this->createWebUrl('send',['op'=> $operation])}"
                 class="btn btn-default">去发布</a>
		</div>
       </form>          
		{$pager}

	</div>
 
</div>

<script type="text/javascript">
        $('#select_all').click(function(){
		$('.article-list :checkbox').prop('checked', $(this).prop('checked'));
	});
  
	function setProperty(obj,id,type){
		$(obj).html($(obj).html() + "...");
		$.post("{php echo $this->createWebUrl('sendlist',array('op'=>'setproperty'))}"
            ,{id:id,type:type, data: obj.getAttribute("data")}
            ,function(d){ 
                $(obj).html($(obj).html().replace("...",""));
				if(type=='isdelete'){
				 $(obj).html( d.data=='1'?'屏蔽':'显示');
				}
				if(type=='isonline'){
				 $(obj).html( d.data=='1'?'上架':'下架');
				}
				$(obj).attr("data",d.data);
				if(d.result==1){
					$(obj).toggleClass("label-info");
				}
			}
			,"json"
		);
	}
</script>